<html>
<head><meta charset="utf-8"><title>crate loading during link resolution · rustdoc · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/index.html">rustdoc</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html">crate loading during link resolution</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="240722017"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722017" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722017">(May 29 2021 at 21:22)</a>:</h4>
<p><span class="user-mention" data-user-id="232545">@Joshua Nelson</span> I was talking with <span class="user-mention" data-user-id="210316">@GuillaumeGomez</span> about the rustdoc ICE in <a href="https://github.com/mautamu/spirv-std-3">https://github.com/mautamu/spirv-std-3</a></p>



<a name="240722027"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722027" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722027">(May 29 2021 at 21:22)</a>:</h4>
<p>which is related to trying to resolve a link in a doc comment on a proc-macro crate</p>



<a name="240722034"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722034" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722034">(May 29 2021 at 21:22)</a>:</h4>
<p>while we're documenting some other crate that depends on the proc-macro</p>



<a name="240722061"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722061" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722061">(May 29 2021 at 21:23)</a>:</h4>
<p>looking at the ICE, the issue appears to be caused by rustdoc loading some crate (and therefore allocating a new <code>CrateNum</code>) that the tcx doesn't know about</p>



<a name="240722068"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722068" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722068">(May 29 2021 at 21:23)</a>:</h4>
<p>which is why we get an ICE in <code>tcx.crate_num(bad_def_id)</code></p>



<a name="240722147"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722147" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722147">(May 29 2021 at 21:25)</a>:</h4>
<p><span class="user-mention" data-user-id="125294">@Aaron Hill</span> the root cause is <a href="https://github.com/rust-lang/rust/issues/83761">https://github.com/rust-lang/rust/issues/83761</a>. The proximate cause is the hack to load crates early is missing a crate for some reason. I don't know why it would be missing</p>



<a name="240722156"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722156" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722156">(May 29 2021 at 21:25)</a>:</h4>
<p>from what I can see, rustdoc clones the resolver, uses it to resolve things (including potentially loading new crate),and then uses the original <code>TyCtxt</code> (with its original resolver)</p>



<a name="240722174"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722174" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722174">(May 29 2021 at 21:25)</a>:</h4>
<p>oh, so we try to load those crates before the <code>TyCtxt</code> is created?</p>



<a name="240722177"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722177" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722177">(May 29 2021 at 21:25)</a>:</h4>
<p>Yes</p>



<a name="240722230"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722230" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722230">(May 29 2021 at 21:26)</a>:</h4>
<p>Fixing the root cause is hard and will take a solid 2 months IMO, I don't think we should try to tackle that right away</p>



<a name="240722232"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722232" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722232">(May 29 2021 at 21:26)</a>:</h4>
<p>ok, that makes sense</p>



<a name="240722248"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722248" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722248">(May 29 2021 at 21:26)</a>:</h4>
<p>I put in about 2 weeks on it a while back and had to stop for my mental health, I expected it to be a ton of work and it was even more than I expected</p>



<a name="240722259"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722259" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722259">(May 29 2021 at 21:26)</a>:</h4>
<p>Fixing the proximate issue should be a lot easier</p>



<a name="240722271"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722271" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722271">(May 29 2021 at 21:27)</a>:</h4>
<p>I don't really understand the MCVE they made</p>



<a name="240722283"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722283" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722283">(May 29 2021 at 21:27)</a>:</h4>
<p>I tried writing my own without a proc macro but it didn't reproduce the crash</p>



<a name="240722290"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722290" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722290">(May 29 2021 at 21:27)</a>:</h4>
<p>I think the problem is around the proc-macro there</p>



<a name="240722292"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722292" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722292">(May 29 2021 at 21:27)</a>:</h4>
<p>ok, here's my current guess</p>



<a name="240722296"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722296" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722296">(May 29 2021 at 21:27)</a>:</h4>
<p>They are handled a bit differently and it impacts dependencies from what <span class="user-mention" data-user-id="125294">@Aaron Hill</span> told me</p>



<a name="240722345"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722345" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722345">(May 29 2021 at 21:28)</a>:</h4>
<p>the crate we're trying to link to (<code>spirv_types</code>) is referenced in two palces</p>



<a name="240722353"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722353" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722353">(May 29 2021 at 21:28)</a>:</h4>
<p>one place is a normal dependency of the crate we're tryng to document (<em>not</em> a proc-macro crate)</p>



<a name="240722364"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722364" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722364">(May 29 2021 at 21:28)</a>:</h4>
<p>the other place is in a doc-comment of a proc-macro crate - that proc-macro crate <em>is</em> a dependency of the crate we're trying to load</p>



<a name="240722385"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722385" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722385">(May 29 2021 at 21:29)</a>:</h4>
<p>the first time through (when we try to load the crates), we fail for some reason (possibbly because of the fact that we don't load proc-macro dependencies)</p>



<a name="240722450"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722450" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722450">(May 29 2021 at 21:30)</a>:</h4>
<p>during the second pass, we succeed, which means that our cloned resolver has a crate loaded that thr tcx doesn't know about</p>



<a name="240722458"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722458" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722458">(May 29 2021 at 21:30)</a>:</h4>
<p>the crate <code>spirv_types</code> is only ever referenced from the proc-macro</p>



<a name="240722460"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722460" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722460">(May 29 2021 at 21:30)</a>:</h4>
<p>which I think is important</p>



<a name="240722487"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722487" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722487">(May 29 2021 at 21:31)</a>:</h4>
<p>yup</p>



<a name="240722490"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722490" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722490">(May 29 2021 at 21:31)</a>:</h4>
<p>adding <code>use spirv_types</code> to the top of <code>lib.rs</code> fixes the ICE</p>



<a name="240722567"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722567" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722567">(May 29 2021 at 21:32)</a>:</h4>
<p><span class="user-mention" data-user-id="125294">@Aaron Hill</span> that tells the resolver about it, but there's actually an even narrower workaround, you can add an intra doc link to it in <a href="http://lib.rs">lib.rs</a></p>



<a name="240722574"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722574" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722574">(May 29 2021 at 21:33)</a>:</h4>
<p>And that will be picked up by rustdoc's early loader</p>



<a name="240722576"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722576" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722576">(May 29 2021 at 21:33)</a>:</h4>
<p>oh, I see the problem</p>



<a name="240722608"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722608" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722608">(May 29 2021 at 21:33)</a>:</h4>
<p>I'm pretty sure that importing the proc-macro does <em>not</em> affect the AST in the normal way</p>



<a name="240722610"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722610" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722610">(May 29 2021 at 21:34)</a>:</h4>
<p>Can a crate be loaded twice and mess up IDs somehow?</p>



<a name="240722611"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722611" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722611">(May 29 2021 at 21:34)</a>:</h4>
<p>as it does for other imports</p>



<a name="240722650"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722650" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722650">(May 29 2021 at 21:34)</a>:</h4>
<p>so the early collector doesn't see it</p>



<a name="240722651"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722651" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722651">(May 29 2021 at 21:34)</a>:</h4>
<p>let me test this</p>



<a name="240722673"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722673" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722673">(May 29 2021 at 21:34)</a>:</h4>
<p><span class="user-mention" data-user-id="210316">@GuillaumeGomez</span> you can test if that's the issue or not, just add a debug statement to the early loader that prints the link</p>



<a name="240722688"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722688" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722688">(May 29 2021 at 21:35)</a>:</h4>
<p>If you don't see spirv_types that means duplicate CrateIds aren't related (whether or not they exist; they still won't be relevant)</p>



<a name="240722695"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722695" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722695">(May 29 2021 at 21:35)</a>:</h4>
<p>gonna check it then</p>



<a name="240722791"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722791" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722791">(May 29 2021 at 21:37)</a>:</h4>
<p><span class="user-mention" data-user-id="232545">@Joshua Nelson</span> How does <code>IntraLinkCrateLoader</code> process attributes on itms imported from other crates?</p>



<a name="240722800"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722800" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722800">(May 29 2021 at 21:37)</a>:</h4>
<p>e.g. if I do <code>use some_other_crate::SomeStruct;</code></p>



<a name="240722842"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722842" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722842">(May 29 2021 at 21:38)</a>:</h4>
<p>and <code>SomeStruct</code> has a doc comment link referencing <code>third_party_crate</code></p>



<a name="240722847"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722847" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722847">(May 29 2021 at 21:38)</a>:</h4>
<p>how does <code>third_party_crate</code> get loaded?</p>



<a name="240722850"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722850" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722850">(May 29 2021 at 21:38)</a>:</h4>
<p>I don't know. However the code is written; I think I assumed that would work because the attribute still gets loaded bit I haven't tested</p>



<a name="240722863"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722863" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722863">(May 29 2021 at 21:39)</a>:</h4>
<p>reexported-items in rustdoc is kinda tape over tape currently...</p>



<a name="240722878"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722878" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722878">(May 29 2021 at 21:39)</a>:</h4>
<p>that appears to be the problem here</p>



<a name="240722884"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722884" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722884">(May 29 2021 at 21:40)</a>:</h4>
<p>I'm not sure how that even works for normal items</p>



<a name="240722928"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722928" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722928">(May 29 2021 at 21:40)</a>:</h4>
<p><code>IntraLinkCrateLoader</code> only implements <code>visit_attribute</code> and <code>visit_item</code></p>



<a name="240722933"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722933" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722933">(May 29 2021 at 21:40)</a>:</h4>
<p>which isn't going to try to 'walk through' any <code>use</code> statements</p>



<a name="240722941"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722941" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722941">(May 29 2021 at 21:40)</a>:</h4>
<p>I only tried to add <code>visit_foreign</code> and same for macros</p>



<a name="240722967"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240722967" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240722967">(May 29 2021 at 21:41)</a>:</h4>
<p>I wonder if I didn't try <code>visit_use_tree</code> unsuccessfully too...</p>



<a name="240723013"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240723013" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240723013">(May 29 2021 at 21:42)</a>:</h4>
<p>the answer is that it doesn't work :)</p>



<a name="240723015"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240723015" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240723015">(May 29 2021 at 21:42)</a>:</h4>
<p>I changed the <code>macros</code> crate to a normal crate (exporting a struct), and got the same ICE</p>



<a name="240723021"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240723021" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240723021">(May 29 2021 at 21:42)</a>:</h4>
<p>Ah right I did! The problem was that I can't get a <code>DefId</code> from a <code>NodeId</code> but ohterwise it didn't change anything</p>



<a name="240723026"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240723026" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240723026">(May 29 2021 at 21:42)</a>:</h4>
<p>I'll push up a fork</p>



<a name="240723032"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240723032" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240723032">(May 29 2021 at 21:43)</a>:</h4>
<p>oh, that's interesting</p>



<a name="240723036"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240723036" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240723036">(May 29 2021 at 21:43)</a>:</h4>
<p>so the problem is reexported items once again</p>



<a name="240723043"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240723043" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240723043">(May 29 2021 at 21:43)</a>:</h4>
<p><a href="https://github.com/Aaron1011/spirv-std-3/tree/no-macro">https://github.com/Aaron1011/spirv-std-3/tree/no-macro</a></p>



<a name="240723055"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240723055" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240723055">(May 29 2021 at 21:43)</a>:</h4>
<p>so, the simplest solution would be to skip processing of intra-doc links on items imported from another crate</p>



<a name="240723106"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240723106" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240723106">(May 29 2021 at 21:44)</a>:</h4>
<p>which should hopefully be a small enough diff for a beta backport</p>



<a name="240723112"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240723112" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240723112">(May 29 2021 at 21:44)</a>:</h4>
<p>That is a breaking change</p>



<a name="240723121"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240723121" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240723121">(May 29 2021 at 21:44)</a>:</h4>
<p>It means all the links will be broken in the docs</p>



<a name="240723127"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240723127" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240723127">(May 29 2021 at 21:44)</a>:</h4>
<p>oh</p>



<a name="240723131"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240723131" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240723131">(May 29 2021 at 21:44)</a>:</h4>
<p>because re-exported links work if the crate is already imported?</p>



<a name="240723133"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240723133" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240723133">(May 29 2021 at 21:44)</a>:</h4>
<p>Because docs on the original  are still displayed whenever docs are inlined</p>



<a name="240723150"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240723150" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240723150">(May 29 2021 at 21:45)</a>:</h4>
<p>I see</p>



<a name="240723157"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240723157" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240723157">(May 29 2021 at 21:45)</a>:</h4>
<p>a more complicated solution would be to disable crate loading in the TyCtxt resolver</p>



<a name="240723160"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240723160" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240723160">(May 29 2021 at 21:45)</a>:</h4>
<p>and return an error whenever it would occur</p>



<a name="240723204"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240723204" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240723204">(May 29 2021 at 21:46)</a>:</h4>
<p>which will cause us to fail to resolve the problematic links, instead of producing an ICE</p>



<a name="240723207"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240723207" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240723207">(May 29 2021 at 21:46)</a>:</h4>
<p>That is also not very satisfying; the links will still be broken - yeah</p>



<a name="240723216"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240723216" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240723216">(May 29 2021 at 21:46)</a>:</h4>
<p>did they ever work?</p>



<a name="240723217"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240723217" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240723217">(May 29 2021 at 21:46)</a>:</h4>
<p>Is it not possible to load the attributes of the original item before the tcx is built?</p>



<a name="240723227"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240723227" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240723227">(May 29 2021 at 21:46)</a>:</h4>
<p><span class="user-mention" data-user-id="125294">@Aaron Hill</span> yes, back when rustdoc loaded all crates unconditionally</p>



<a name="240723228"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240723228" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240723228">(May 29 2021 at 21:46)</a>:</h4>
<p>the specific kind of case in that repository, I mean - not the general re-exported links where the crate is already loaded</p>



<a name="240723240"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240723240" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240723240">(May 29 2021 at 21:47)</a>:</h4>
<p>well, an alternate solution would be to try to 'fully explore' all of the items in the imported visitor</p>



<a name="240723249"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240723249" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240723249">(May 29 2021 at 21:47)</a>:</h4>
<p>which I think would mean trying to 'follow' <code>use</code> statements in the AST visitor</p>



<a name="240723253"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240723253" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240723253">(May 29 2021 at 21:47)</a>:</h4>
<p>not sure how hard that would be</p>



<a name="240723313"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240723313" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240723313">(May 29 2021 at 21:48)</a>:</h4>
<p>I tried but got stuck quicky trying to get something out of the <code>NodeId</code>...</p>



<a name="240723356"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240723356" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240723356">(May 29 2021 at 21:50)</a>:</h4>
<p>I was actually able to get a <code>DefId</code> from the <code>NodeId</code>, but I think it was referring to the <code>use</code> and not to the item imported (but maybe I'm wrong there)</p>



<a name="240723466"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240723466" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240723466">(May 29 2021 at 21:52)</a>:</h4>
<p><span class="user-mention silent" data-user-id="125294">Aaron Hill</span> <a href="#narrow/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution/near/240723240">said</a>:</p>
<blockquote>
<p>well, an alternate solution would be to try to 'fully explore' all of the items in the imported visitor</p>
</blockquote>
<p>I think it's worth trying, at least for an hour or so.</p>
<p><span class="user-mention" data-user-id="125294">@Aaron Hill</span> interested to hear your opinions on the root cause btw - I suggested making the resolver still available in the TyCtxt, which <span class="user-mention" data-user-id="123856">@Vadim Petrochenkov</span> was hesitant to do because it's a giant change. But the rustdoc change he suggested is at least as big and doesn't help with long-term goals the way making the resolver always available does. <a href="https://github.com/rust-lang/rust/issues/83761#issuecomment-812723093">https://github.com/rust-lang/rust/issues/83761#issuecomment-812723093</a></p>
<p>Probably the next step forward for that is to make an MCP and then dedicate lots of time to getting it working.</p>



<a name="240723506"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240723506" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240723506">(May 29 2021 at 21:53)</a>:</h4>
<p>I don't have a strong opinion on that</p>



<a name="240723516"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240723516" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240723516">(May 29 2021 at 21:53)</a>:</h4>
<p>I know very little about how how path resolution works</p>



<a name="240723531"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240723531" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240723531">(May 29 2021 at 21:53)</a>:</h4>
<p>np, I will try to do some reading on proposals for making path resolution incremental so I can summarize them in the MCP</p>



<a name="240723598"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240723598" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240723598">(May 29 2021 at 21:55)</a>:</h4>
<p>Thanks to both of you. In the meantime, if we can't make a fix, there is still <a href="https://github.com/rust-lang/rust/pull/85749">https://github.com/rust-lang/rust/pull/85749</a> (which revert to loading ALL crates)</p>



<a name="240723644"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240723644" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240723644">(May 29 2021 at 21:56)</a>:</h4>
<p>We still have a few weeks before next release though, so let's just keep it as backup</p>



<a name="240747900"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240747900" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240747900">(May 30 2021 at 09:47)</a>:</h4>
<p>I see there's some progress on minimizing <a href="https://github.com/rust-lang/rust/issues/84738">#84738</a>, could someone post a minimized self-contained reproduction to <a href="https://github.com/rust-lang/rust/issues/84738">https://github.com/rust-lang/rust/issues/84738</a>?</p>



<a name="240752645"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240752645" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240752645">(May 30 2021 at 12:05)</a>:</h4>
<p>(deleted)</p>



<a name="240752800"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/crate%20loading%20during%20link%20resolution/near/240752800" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution.html#240752800">(May 30 2021 at 12:09)</a>:</h4>
<p>Done</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>